<template>
	<view class="Search" :style="{ background: list.SearchColor }">
		<u-search
			:placeholder="list.title"
			:bgColor="list.backgroundInput"
			:color="list.InputTextColor"
			:borderColor="list.isBorder == false ? list.backgroundInput : list.BorderColor"
			v-model="keyword"
			:shape="list.InputStyle == 20 ? 'square' : 'round'"
			:clearabled="list.clearabled"
			:show-action="list.action"
			actionText="搜索"
			:animation="false"
			:inputAlign="list.InputTextAligh"
			@search="SearchValue"
			@custom="SearchValue"
			@clear="SearchValue"
		></u-search>
	</view>
</template>
<script>
export default {
	name: '',
	components: {},
	data() {
		return {
			keyword: '',
			list: null
		};
	},
	props: {
		config: {
			type: Object //校验类型
			// default: ''
		}
	},
	mounted() {
		var that = this;
		this.list = this.config;
		// console.log(this.config);
	},
	methods: {
		SearchValue(e) {
			var that = this;
			// console.log(e);
			var value = e != undefined ? e : '';
			this.$emit('Search', value);
		}
	}
};
</script>
<style lang="less" scoped>
.Search {
	padding: 20rpx;
	// background: #fff;
	border-bottom: 1px solid #f5f5f5;
}
</style>
